#include<iostream>
#include<math.h>
using namespace std;
class Point 
{
    private:
		double X,Y;
	public:
		Point (double a ,double b);
		Point (Point &p);
		double GetX();
		double GetY();
};
Point::Point(double a ,double b)
{
	X=a;
	Y=b;
}
Point::Point(Point &p)
{
	X=p.X;
	Y=p.Y;
}
double Point::GetX()
{
	return X;
}
double Point::GetY()
{
	return Y;
}
class Line
{
	private:
		Point A,B;
		double length;
	public:
		Line(Point p1,Point p2);
		double GetLength();
};
Line::Line(Point p1,Point p2):A(0,0),B(0,0)
{
	length=sqrt((p1.GetX()-p2.GetX())*(p1.GetX()-p2.GetX())+(p1.GetY()-p2.GetY())*(p1.GetY()-p2.GetY()));
}
double Line::GetLength()
{
	return length;		
}
int main()
{
	Point p1(0,0),p2(3,4);
	Line lin(p1,p2);
	cout<<"线段的长度为"<<lin.GetLength()<<endl;
	return 0;
}
